package com.rent.rent_back_end.controller;

import com.rent.rent_back_end.domain.User;
import com.rent.rent_back_end.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用户测试控制类
 */
@RestController
@CrossOrigin
@RequestMapping("user")
public class UserController {

    @Resource
    UserService userService;

    @GetMapping
    public List<User> getAllUser() {
        return userService.list();
    }
}
